﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FrameConstructor;

namespace TetrisShape
{
    public class Render
    {
        public void PrintShape(Shape sh)
        {
            foreach (Block bl in sh.ReturnBlock)
            {
                Console.CursorVisible = false;
                Console.SetCursorPosition(bl.X, bl.Y);
                Console.WriteLine("■");
            }
        }

        public void ClearShape(Shape sh, Frame fr)
        {
            foreach (Block bl in sh.ReturnBlock)
            {
                if (bl.X == fr.StartX + 5 && bl.Y == fr.StartY + 1 || bl.X == fr.StartX + 6 && bl.Y == fr.StartY + 1 || bl.X == fr.StartX + 7 && bl.Y == fr.StartY + 1)
                { }
                else
                {
                    Console.SetCursorPosition(bl.X, bl.Y - 1);
                    Console.WriteLine(" ");
                }
            }
        }
    }
}
